<?php

/**
 * Cliente form base class.
 *
 * @package    proyectoMOD2
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 12815 2008-11-09 10:43:58Z fabien $
 */
class BaseClienteForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'         => new sfWidgetFormInputHidden(),
      'tipo'       => new sfWidgetFormPropelSelect(array('model' => 'Tipos', 'add_empty' => false)),
      'nombre'     => new sfWidgetFormInput(),
      'cliente_id' => new sfWidgetFormPropelSelect(array('model' => 'Cliente', 'add_empty' => true)),
      'telf1'      => new sfWidgetFormInput(),
      'telf2'      => new sfWidgetFormInput(),
      'direccion'  => new sfWidgetFormTextarea(),
    ));

    $this->setValidators(array(
      'id'         => new sfValidatorPropelChoice(array('model' => 'Cliente', 'column' => 'id', 'required' => false)),
      'tipo'       => new sfValidatorString(array('max_length' => 40)),
      'nombre'     => new sfValidatorString(array('max_length' => 40)),
      'cliente_id' => new sfValidatorInteger(array('required' => false)),
      'telf1'      => new sfValidatorString(array('max_length' => 40)),
      'telf2'      => new sfValidatorString(array('max_length' => 40, 'required' => false)),
      'direccion'  => new sfValidatorString(array('max_length' => 50)),
    ));

    $this->widgetSchema->setNameFormat('cliente[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Cliente';
  }


}
